<?php
namespace app\appapi\controller;
use think\Controller;
use think\Request;
use think\Db;
use app\appapi\WeShare;

class WeMiscellaneous extends Common

{
    //获取行业信息列表
    public function getIndustryList($value='')
    {
        $where['State'] = ['=',1];
        $order = 'Sort desc';
        if($re = Db::name('industry')->where($where)->order($order)->select())
        return json_encode(['code'=>10001,'msg'=>'获取数据成功','data'=>$re]);
        return json_encode(['code'=>10002,'msg'=>'网络异常']);
    }
    //获取兴趣爱好信息列表
    public function getHobbyList($value='')
    {
        $where['State'] = ['=',1];
        $order = 'Sort desc';
        if($re = Db::name('industry')->where($where)->order($order)->select())
        return json_encode(['code'=>10001,'msg'=>'获取数据成功','data'=>$re]);
        return json_encode(['code'=>10002,'msg'=>'网络异常']);
    }
    //获取园区信息列表
    public function getCampusList($value='')
    {
        $where['State'] = ['=',1];
        $order = 'Sort desc';
        if($re = Db::name('industry')->where($where)->order($order)->select())
        return json_encode(['code'=>10001,'msg'=>'获取数据成功','data'=>$re]);
        return json_encode(['code'=>10002,'msg'=>'网络异常']);
    }
     //获取地区信息列表
    public function getRegionList($value='')
    {
        $re = Db::name('region')->select();
        if($arr = getRegionTree($re))
        return json_encode(['code'=>10001,'msg'=>'获取数据成功','data'=>$arr]);
        return json_encode(['code'=>10002,'msg'=>'网络异常']);
    }
}
